package Executor;


import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        int start;
        int end;
        int numberOfThreads;

        System.out.println("Please input start number, end number and number of threads separated by space: ");

        Scanner scanner = new Scanner(System.in);

        start = scanner.nextInt();
        end = scanner.nextInt();
        numberOfThreads = scanner.nextInt();

        Runner runner = new Runner(start, end, numberOfThreads);

        runner.runWithExecutors();


        System.out.println("Number of primes within " + start + " to " + end + " is "
                + runner.getResult());
        System.out.println("Calculation finished in "
                + runner.getRunningTime() + " ms with Executors with " +  numberOfThreads
                + " threads");

        runner.run();

        System.out.println("Calculation finished in "
                + runner.getRunningTime() + " ms with " + numberOfThreads
                + " threads");

    }

}
